﻿using Pattern22命令模式.Base;
using Pattern22命令模式.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern22命令模式
{
    //皇帝
    public class Client
    {
        public void Start()
        {
            IReceiver receiver = new General();//命令的接收者 ->袁崇焕
            Invoker invoker = new Invoker();//命令调用者 ->宦官

            CommandBase command1 = new OfferCommand(receiver);
            invoker.SetCommand(command1);
            invoker.Reading();

            Console.WriteLine("4年后...");

            CommandBase command2 = new ReturnCommand(receiver);
            invoker.SetCommand(command2);
            invoker.Reading();
        }
    }
}
